package org.anachronos.jeep.core.attach;

import java.util.List;

/**
 * Provides profiler access to all running jvms on local computer.
 * 
 * @author km
 */
public interface VirtualMachineRemoteControl {
	/**
	 * The jmx object name of this MBean.
	 */
	String NAME = "org.anachronos.jeep:type=" + VirtualMachineRemoteControl.class.getSimpleName();
	
	/**
	 * System property to mark own JVM processes.
	 */
	String OWN_JVMS_MARKER = "__OWN_JVM_MARKER__";
	
	/**
	 * Lists all jvms running on the local computer.
	 * @return list of all running jvms
	 */
	List<VirtualMachineAttachement> list();

	/**
	 * Attaches the profiler to the given jvm with the given config file.
	 * 
	 * @param vmAttachment jvm to attach profiler
	 * @param configFile profiler config file
	 * @return update virtual machine attchment
	 * @throws Exception
	 */
	VirtualMachineAttachement attach(VirtualMachineAttachement vmAttachment, String configFile) throws Exception;
}
